home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 July: Mac OS SDK / Dev.CD Jul 00 SDK2.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / EPPC.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  5.4 KB  |  207 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        EPPC.h
  3.  
  4.      Contains:    High Level Event Manager Interfaces.
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1988-1999, 1999 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __EPPC__
  18. #define __EPPC__
  19.  
  20. #ifndef __MACERRORS__
  21.     #include <MacErrors.h>
  22. #endif
  23.  
  24. #ifndef __APPLETALK__
  25.     #include <AppleTalk.h>
  26. #endif
  27.  
  28. #ifndef __FILES__
  29.     #include <Files.h>
  30. #endif
  31.  
  32. #ifndef __PPCTOOLBOX__
  33.     #include <PPCToolbox.h>
  34. #endif
  35.  
  36. #ifndef __PROCESSES__
  37.     #include <Processes.h>
  38. #endif
  39.  
  40. #ifndef __EVENTS__
  41.     #include <Events.h>
  42. #endif
  43.  
  44.  
  45.  
  46.  
  47. #if PRAGMA_ONCE
  48. #pragma once
  49. #endif
  50.  
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif
  54.  
  55. #if PRAGMA_IMPORT
  56. #pragma import on
  57. #endif
  58.  
  59. #if PRAGMA_STRUCT_ALIGN
  60.     #pragma options align=mac68k
  61. #elif PRAGMA_STRUCT_PACKPUSH
  62.     #pragma pack(push, 2)
  63. #elif PRAGMA_STRUCT_PACK
  64.     #pragma pack(2)
  65. #endif
  66.  
  67. enum {
  68.                                                                 /* postOptions currently supported */
  69.     receiverIDMask                = 0x0000F000,
  70.     receiverIDisPSN                = 0x00008000,
  71.     receiverIDisSignature        = 0x00007000,
  72.     receiverIDisSessionID        = 0x00006000,
  73.     receiverIDisTargetID        = 0x00005000,
  74.     systemOptionsMask            = 0x00000F00,
  75.     nReturnReceipt                = 0x00000200,
  76.     priorityMask                = 0x000000FF,
  77.     nAttnMsg                    = 0x00000001
  78. };
  79.  
  80. enum {
  81.                                                                 /* constant for return receipts */
  82.     HighLevelEventMsgClass        = FOUR_CHAR_CODE('jaym'),
  83.     rtrnReceiptMsgID            = FOUR_CHAR_CODE('rtrn')
  84. };
  85.  
  86. enum {
  87.     msgWasPartiallyAccepted        = 2,
  88.     msgWasFullyAccepted            = 1,
  89.     msgWasNotAccepted            = 0
  90. };
  91.  
  92.  
  93. struct TargetID {
  94.     long                             sessionID;
  95.     PPCPortRec                         name;
  96.     LocationNameRec                 location;
  97.     PPCPortRec                         recvrName;
  98. };
  99. typedef struct TargetID                    TargetID;
  100. typedef TargetID *                        TargetIDPtr;
  101. typedef TargetIDPtr *                    TargetIDHandle;
  102. typedef TargetIDHandle                     TargetIDHdl;
  103.  
  104. typedef TargetID                         SenderID;
  105. typedef SenderID *                        SenderIDPtr;
  106.  
  107. struct HighLevelEventMsg {
  108.     unsigned short                     HighLevelEventMsgHeaderLength;
  109.     unsigned short                     version;
  110.     unsigned long                     reserved1;
  111.     EventRecord                     theMsgEvent;
  112.     unsigned long                     userRefcon;
  113.     unsigned long                     postingOptions;
  114.     unsigned long                     msgLength;
  115. };
  116. typedef struct HighLevelEventMsg        HighLevelEventMsg;
  117. typedef HighLevelEventMsg *                HighLevelEventMsgPtr;
  118. typedef HighLevelEventMsgPtr *            HighLevelEventMsgHandle;
  119. typedef HighLevelEventMsgHandle         HighLevelEventMsgHdl;
  120. typedef CALLBACK_API( Boolean , GetSpecificFilterProcPtr )(void *contextPtr, HighLevelEventMsgPtr msgBuff, const TargetID *sender);
  121. typedef STACK_UPP_TYPE(GetSpecificFilterProcPtr)                 GetSpecificFilterUPP;
  122. #if OPAQUE_UPP_TYPES
  123.     EXTERN_API(GetSpecificFilterUPP)
  124.     NewGetSpecificFilterUPP           (GetSpecificFilterProcPtr userRoutine);
  125.  
  126.     EXTERN_API(void)
  127.     DisposeGetSpecificFilterUPP       (GetSpecificFilterUPP    userUPP);
  128.  
  129.     EXTERN_API(Boolean)
  130.     InvokeGetSpecificFilterUPP       (void *                    contextPtr,
  131.                                     HighLevelEventMsgPtr    msgBuff,
  132.                                     const TargetID *        sender,
  133.                                     GetSpecificFilterUPP    userUPP);
  134.  
  135. #else
  136.     enum { uppGetSpecificFilterProcInfo = 0x00000FD0 };             /* pascal 1_byte Func(4_bytes, 4_bytes, 4_bytes) */
  137.     #define NewGetSpecificFilterUPP(userRoutine)                     (GetSpecificFilterUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppGetSpecificFilterProcInfo, GetCurrentArchitecture())
  138.     #define DisposeGetSpecificFilterUPP(userUPP)                     DisposeRoutineDescriptor(userUPP)
  139.     #define InvokeGetSpecificFilterUPP(contextPtr, msgBuff, sender, userUPP)  (Boolean)CALL_THREE_PARAMETER_UPP((userUPP), uppGetSpecificFilterProcInfo, (contextPtr), (msgBuff), (sender))
  140. #endif
  141. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  142. #define NewGetSpecificFilterProc(userRoutine)                     NewGetSpecificFilterUPP(userRoutine)
  143. #define CallGetSpecificFilterProc(userRoutine, contextPtr, msgBuff, sender) InvokeGetSpecificFilterUPP(contextPtr, msgBuff, sender, userRoutine)
  144. #if CALL_NOT_IN_CARBON
  145. EXTERN_API( OSErr )
  146. PostHighLevelEvent                (const EventRecord *    theEvent,
  147.                                  void *                    receiverID,
  148.                                  unsigned long             msgRefcon,
  149.                                  void *                    msgBuff,
  150.                                  unsigned long             msgLen,
  151.                                  unsigned long             postingOptions)                        THREEWORDINLINE(0x3F3C, 0x0034, 0xA88F);
  152.  
  153. #endif  /* CALL_NOT_IN_CARBON */
  154.  
  155. #if CALL_NOT_IN_CARBON
  156. EXTERN_API( OSErr )
  157. AcceptHighLevelEvent            (TargetID *                sender,
  158.                                  unsigned long *        msgRefcon,
  159.                                  void *                    msgBuff,
  160.                                  unsigned long *        msgLen)                                THREEWORDINLINE(0x3F3C, 0x0033, 0xA88F);
  161.  
  162. #endif  /* CALL_NOT_IN_CARBON */
  163.  
  164. #if CALL_NOT_IN_CARBON
  165. EXTERN_API( OSErr )
  166. GetProcessSerialNumberFromPortName (const PPCPortRec *    portName,
  167.                                  ProcessSerialNumber *    pPSN)                                THREEWORDINLINE(0x3F3C, 0x0035, 0xA88F);
  168.  
  169. #endif  /* CALL_NOT_IN_CARBON */
  170.  
  171. #if CALL_NOT_IN_CARBON
  172. EXTERN_API( OSErr )
  173. GetPortNameFromProcessSerialNumber (PPCPortRec *        portName,
  174.                                  const ProcessSerialNumber * pPSN)                            THREEWORDINLINE(0x3F3C, 0x0046, 0xA88F);
  175.  
  176. #endif  /* CALL_NOT_IN_CARBON */
  177.  
  178. #if CALL_NOT_IN_CARBON
  179. EXTERN_API( Boolean )
  180. GetSpecificHighLevelEvent        (GetSpecificFilterUPP     aFilter,
  181.                                  void *                    contextPtr,
  182.                                  OSErr *                err)                                THREEWORDINLINE(0x3F3C, 0x0045, 0xA88F);
  183.  
  184. #endif  /* CALL_NOT_IN_CARBON */
  185.  
  186.  
  187. #if PRAGMA_STRUCT_ALIGN
  188.     #pragma options align=reset
  189. #elif PRAGMA_STRUCT_PACKPUSH
  190.     #pragma pack(pop)
  191. #elif PRAGMA_STRUCT_PACK
  192.     #pragma pack()
  193. #endif
  194.  
  195. #ifdef PRAGMA_IMPORT_OFF
  196. #pragma import off
  197. #elif PRAGMA_IMPORT
  198. #pragma import reset
  199. #endif
  200.  
  201. #ifdef __cplusplus
  202. }
  203. #endif
  204.  
  205. #endif /* __EPPC__ */
  206.  
  207.